<template><web-view class="w-full h-full display-block" :src="webUrl" @message="handleMessage" @onPostMessage="handleMessage"></web-view></template>

<script setup>
import { ref } from 'vue'
import { onLoad } from '@dcloudio/uni-app'

const webUrl = ref('http://localhost:5175/#/?token=12334')

const handleMessage = (e) => {
  console.log('handleMessage e :>> ', e)
}

onLoad((options) => {
  console.log('onLoad options :>> ', options)

  console.log('uni.getStorageSync() :>> ', uni.getStorageSync('storage_key'))
  window.addEventListener('message', handleMessage, false) //监听事件
})
</script>

<style></style>
